<?php
/*
 * Created on 01.02.2006
 *
 */

class conf_viewMappingHandler
{

    function startElement (& $sender, $attrs, $line)
    {
        $action['type'] = 'action';
        $action['mapping'] = $attrs['class'];
        if (!empty($attrs['method']))
            $action['mapping'] .= '.'.$attrs['method'];
        $sender->pushParent($action);
        if (empty($attrs['class']))
            die("Attribute class missing in tag viewMapping in line $line\n"); 
        if (!empty($attrs['bypassViewMapping']))        
                $sender->appendCode('$actions['.$action['mapping'].'] = array(\'class\' => '.$attrs['class']
                    .', \'methodmapping\' => false'
                    .', \'bypassViewMapping\' => '.(($attrs['bypassViewMapping'] == "'true'")?'true':'false').");\n");
    }
    
    function endElement (& $sender)
    {
        $sender->popParent();
    }

} 

?>